//------------------------------------------------------------------------------
//
//  File: CDialogList.cpp
//
//  Copyright (C) 2008 Visual.Wei
//  Author: Wei Shuai <cpuwolf@sina.com>
//
//  Common Class for Device Driver Development
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
//
#include "DialogList.h"

CDialogList::CDialogList(void)
{
	m_Iter = mylist.begin( );
}

CDialogList::~CDialogList(void)
{
}

BOOL CDialogList::Add(const TCHAR *caption,PMDialog * pdlg)
{
	struct vlist ml;
	ml.TabCaption=caption;
	ml.pdlg=pdlg;
	//m_Iter++;
	mylist.push_back( ml );
	
	return 0;
}

PMDialog * CDialogList::FindDialog(int index)
{
	int i;
	list <struct vlist>::iterator Iter;

	for ( i=0,Iter = mylist.begin( ); Iter != mylist.end( ); Iter++,i++)
	{
		if(i==index)
			return Iter->pdlg;
	}
	return NULL;
}